package com.exercise.algorithm.tree;

import com.fun.frame.SourceCode;

public class BinaryTreeNode extends SourceCode {

    private int data;

    private BinaryTreeNode left;

    private BinaryTreeNode right;

    private BinaryTreeNode() {

    }

    public BinaryTreeNode(int value) {
        this.setData(value);
    }


    public int getData() {
        return data;
    }

    public void setData(int data) {
        this.data = data;
    }

    public BinaryTreeNode getLeft() {
        return left;
    }

    public void setLeft(BinaryTreeNode left) {
        this.left = left;
    }

    public BinaryTreeNode getRight() {
        return right;
    }

    public void setRight(BinaryTreeNode right) {
        this.right = right;
    }

    public boolean noChild() {
        return left == null && right == null;
    }
}
